<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>EOS.IO: contracts/eoslib/types.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN1.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ae9b15dd87e066e1908bbd90e8f38627.html">contracts</a></li><li class="navelem"><a class="el" href="dir_3fea0bf1ce879ce73e6ecec98007efcd.html">eoslib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">types.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="types_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="types_8h.html">eoslib/types.h</a>&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">namespace  </span><a class="code" href="namespaceeos.html">eos</a> {</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;   <span class="keyword">static</span> constexpr <span class="keywordtype">char</span> char_to_symbol( <span class="keywordtype">char</span> c ) {</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;      <span class="keywordflow">if</span>( c &gt;= <span class="charliteral">&#39;a&#39;</span> &amp;&amp; c &lt;= <span class="charliteral">&#39;z&#39;</span> )</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;         <span class="keywordflow">return</span> (c - <span class="charliteral">&#39;a&#39;</span>) + 6;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;      <span class="keywordflow">if</span>( c &gt;= <span class="charliteral">&#39;1&#39;</span> &amp;&amp; c &lt;= <span class="charliteral">&#39;5&#39;</span> )</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;         <span class="keywordflow">return</span> (c - <span class="charliteral">&#39;1&#39;</span>) + 1;</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;      <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;   }</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;   <span class="keyword">static</span> constexpr <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> string_to_name( <span class="keyword">const</span> <span class="keywordtype">char</span>* str ) {</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;      <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> len = 0;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;      <span class="keywordflow">while</span>( str[len] ) ++len;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;      <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> value = 0;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;      <span class="keywordflow">for</span>( <a class="code" href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a> i = 0; i &lt;= 12; ++i ) {</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;         <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> c = 0;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;         <span class="keywordflow">if</span>( i &lt; len &amp;&amp; i &lt;= 12 ) c = char_to_symbol( str[i] );</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;         <span class="keywordflow">if</span>( i &lt; 12 ) {</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;            c &amp;= 0x1f;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;            c &lt;&lt;= 64-5*(i+1);</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;         }</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;         <span class="keywordflow">else</span> {</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            c &amp;= 0x0f;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;         }</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;         value |= c;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;      }</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;      <span class="keywordflow">return</span> value;</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;   }</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="group__types.html#gaf9c1edb0e0da55ec6ba09f32f6839529">   58</a></span>&#160;<span class="preprocessor">   #define N(X) ::eosio::string_to_name(#X)</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="structeos_1_1_name.html">   70</a></span>&#160;   <span class="keyword">struct </span><a class="code" href="structeos_1_1_name.html">Name</a> {</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="structeos_1_1_name.html#a671ad25d845f18cc43236a4557ef3ed5">   71</a></span>&#160;      <a class="code" href="structeos_1_1_name.html#a671ad25d845f18cc43236a4557ef3ed5">Name</a>( <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> v = 0 ): value(v) {}</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structeos_1_1_name.html#ac3926ad20f7e040be388f77f7f8beb70">   72</a></span>&#160;      <span class="keyword">operator</span> <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a>()<span class="keyword">const </span>{ <span class="keywordflow">return</span> <a class="code" href="structeos_1_1_name.html#a5d5bf2890d44c3d53e902599e95da38a">value</a>; }</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structeos_1_1_name.html#a32df73b17ea53322340af95b243e2cb6">   74</a></span>&#160;      <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code" href="structeos_1_1_name.html#a32df73b17ea53322340af95b243e2cb6">operator==</a>( <span class="keyword">const</span> <a class="code" href="structeos_1_1_name.html">Name</a>&amp; a, <span class="keyword">const</span> <a class="code" href="structeos_1_1_name.html">Name</a>&amp; b ) { <span class="keywordflow">return</span> a.<a class="code" href="structeos_1_1_name.html#a5d5bf2890d44c3d53e902599e95da38a">value</a> == b.<a class="code" href="structeos_1_1_name.html#a5d5bf2890d44c3d53e902599e95da38a">value</a>; }</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structeos_1_1_name.html#a5d5bf2890d44c3d53e902599e95da38a">   75</a></span>&#160;      <a class="code" href="group__types.html#gad67b43dc23285b01176f4c181c59fc23">AccountName</a> value = 0;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;   };</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="structeos_1_1remove__reference.html#acfd17788f4908fa7276ade978a94f2b9">   85</a></span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span><a class="code" href="structeos_1_1remove__reference.html">remove_reference</a>           { <span class="keyword">typedef</span> T <a class="code" href="structeos_1_1remove__reference.html#acfd17788f4908fa7276ade978a94f2b9">type</a>; };</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="structeos_1_1remove__reference_3_01_t_01_6_01_4.html#ac7a78aa04a58d44d919f666b49cd6709">   86</a></span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span><a class="code" href="structeos_1_1remove__reference.html">remove_reference</a>&lt;T&amp;&gt;       { <span class="keyword">typedef</span> T <a class="code" href="structeos_1_1remove__reference_3_01_t_01_6_01_4.html#ac7a78aa04a58d44d919f666b49cd6709">type</a>; };</div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="structeos_1_1remove__reference_3_01const_01_t_01_6_01_4.html#a9a1d54d331794296bf736eb59f051eef">   87</a></span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt; <span class="keyword">struct </span><a class="code" href="structeos_1_1remove__reference.html">remove_reference</a>&lt;const T&amp;&gt; { <span class="keyword">typedef</span> T <a class="code" href="structeos_1_1remove__reference_3_01const_01_t_01_6_01_4.html#a9a1d54d331794296bf736eb59f051eef">type</a>; };</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;} <span class="comment">// namespace eos</span></div><div class="ttc" id="types_8h_html"><div class="ttname"><a href="types_8h.html">types.h</a></div></div>
<div class="ttc" id="group__types_html_gad67b43dc23285b01176f4c181c59fc23"><div class="ttname"><a href="group__types.html#gad67b43dc23285b01176f4c181c59fc23">AccountName</a></div><div class="ttdeci">uint64_t AccountName</div><div class="ttdef"><b>Definition:</b> types.h:24</div></div>
<div class="ttc" id="structeos_1_1remove__reference_html"><div class="ttname"><a href="structeos_1_1remove__reference.html">eosio::remove_reference</a></div><div class="ttdef"><b>Definition:</b> types.hpp:85</div></div>
<div class="ttc" id="structeos_1_1_name_html"><div class="ttname"><a href="structeos_1_1_name.html">eosio::Name</a></div><div class="ttdoc">wraps a uint64_t to ensure it is only passed to methods that expect a Name </div><div class="ttdef"><b>Definition:</b> types.hpp:70</div></div>
<div class="ttc" id="group__types_html_gaaa5d1cd013383c889537491c3cfd9aad"><div class="ttname"><a href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a></div><div class="ttdeci">unsigned long long uint64_t</div><div class="ttdef"><b>Definition:</b> types.h:17</div></div>
<div class="ttc" id="structeos_1_1remove__reference_html_acfd17788f4908fa7276ade978a94f2b9"><div class="ttname"><a href="structeos_1_1remove__reference.html#acfd17788f4908fa7276ade978a94f2b9">eosio::remove_reference::type</a></div><div class="ttdeci">T type</div><div class="ttdef"><b>Definition:</b> types.hpp:85</div></div>
<div class="ttc" id="group__types_html_ga06896e8c53f721507066c079052171f8"><div class="ttname"><a href="group__types.html#ga06896e8c53f721507066c079052171f8">uint32_t</a></div><div class="ttdeci">unsigned long uint32_t</div><div class="ttdef"><b>Definition:</b> types.h:18</div></div>
<div class="ttc" id="structeos_1_1_name_html_a32df73b17ea53322340af95b243e2cb6"><div class="ttname"><a href="structeos_1_1_name.html#a32df73b17ea53322340af95b243e2cb6">eosio::Name::operator==</a></div><div class="ttdeci">friend bool operator==(const Name &amp;a, const Name &amp;b)</div><div class="ttdef"><b>Definition:</b> types.hpp:74</div></div>
<div class="ttc" id="namespaceeos_html"><div class="ttname"><a href="namespaceeos.html">eos</a></div><div class="ttdef"><b>Definition:</b> math.hpp:8</div></div>
<div class="ttc" id="structeos_1_1remove__reference_3_01_t_01_6_01_4_html_ac7a78aa04a58d44d919f666b49cd6709"><div class="ttname"><a href="structeos_1_1remove__reference_3_01_t_01_6_01_4.html#ac7a78aa04a58d44d919f666b49cd6709">eosio::remove_reference&lt; T &amp; &gt;::type</a></div><div class="ttdeci">T type</div><div class="ttdef"><b>Definition:</b> types.hpp:86</div></div>
<div class="ttc" id="structeos_1_1remove__reference_3_01const_01_t_01_6_01_4_html_a9a1d54d331794296bf736eb59f051eef"><div class="ttname"><a href="structeos_1_1remove__reference_3_01const_01_t_01_6_01_4.html#a9a1d54d331794296bf736eb59f051eef">eosio::remove_reference&lt; const T &amp; &gt;::type</a></div><div class="ttdeci">T type</div><div class="ttdef"><b>Definition:</b> types.hpp:87</div></div>
<div class="ttc" id="structeos_1_1_name_html_a5d5bf2890d44c3d53e902599e95da38a"><div class="ttname"><a href="structeos_1_1_name.html#a5d5bf2890d44c3d53e902599e95da38a">eosio::Name::value</a></div><div class="ttdeci">AccountName value</div><div class="ttdef"><b>Definition:</b> types.hpp:75</div></div>
<div class="ttc" id="structeos_1_1_name_html_a671ad25d845f18cc43236a4557ef3ed5"><div class="ttname"><a href="structeos_1_1_name.html#a671ad25d845f18cc43236a4557ef3ed5">eosio::Name::Name</a></div><div class="ttdeci">Name(uint64_t v=0)</div><div class="ttdef"><b>Definition:</b> types.hpp:71</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
